// ++++++++++++++++++++++++++++++++++++++++
// 《零基础Go语言算法实战》源码
// ++++++++++++++++++++++++++++++++++++++++
// Author:廖显东（ShirDon）
// Blog:https://www.shirdon.com/
// Gitee:https://gitee.com/shirdonl/goAlgorithms.git
// Buy link :https://item.jd.com/14101229.html
// ++++++++++++++++++++++++++++++++++++++++

package main

import (
	"fmt"
)

func main() {
	deferFunc()
}

func deferFunc() {
	defer func() { fmt.Println("value1") }()
	defer func() { fmt.Println("value2") }()
	defer func() { fmt.Println("value3") }()

	panic("异常")
}

//$ go run interview1-31.go
//value3
//value2
//value1
//panic: 异常
//
//goroutine 1 [running]:
//main.deferFunc()
